<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<script src="../js/jquery-1.11.3.js"></script>
<style>
.imgpic {
	display: inline-block;
	width: 200px;
	width: 180px;
}
</style>
<script>
	$(function() {
		$("body").on(
				"click",
				".deleteImg",
				function() {
					var s = "<input type='hidden' class='cakeimgid' value='"
							+ $(this).parents(".caption").prev().val()
							+ "'name='deleteid'/>";
					$(".deletedemo").append(s);
					$(this).parents(".showcakeimg").remove();
				})
	})
</script>
</head>
<body>
	<div class="container">
		<div class="row">
			<nav class="navbar navbar-default">
				<div class="container-fluid">
					<!-- Brand and toggle get grouped for better mobile display -->
					<div class="navbar-header">
						<button type="button" class="navbar-toggle collapsed"
							data-toggle="collapse"
							data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
							<span class="sr-only">Toggle navigation</span> <span
								class="icon-bar"></span> <span class="icon-bar"></span> <span
								class="icon-bar"></span>
						</button>
						<a class="navbar-brand" href="#">21Cake</a>
					</div>
					<div class="collapse navbar-collapse"
						id="bs-example-navbar-collapse-1">
						<ul class="nav navbar-nav">
							<li class="active"><a href="#">首页 <span class="sr-only">(current)</span></a></li>
							<li class="dropdown"><a href="#" class="dropdown-toggle"
								data-toggle="dropdown" role="button" aria-haspopup="true"
								aria-expanded="false"><span class="caret"></span></a></li>
						</ul>
						<ul class="nav navbar-nav navbar-right">
							<li><a href="adminLogin">注销</a></li>
							<li><a href="#">${LoginAdmin.userName}</a></li>
							<li class="dropdown"><a href="#" class="dropdown-toggle"
								data-toggle="dropdown" role="button" aria-haspopup="true"
								aria-expanded="false">用户中心<span class="caret"></span></a>
								<ul class="dropdown-menu">
									<li><a href="#">增加管理员</a></li>
									<li><a href="#">修改密码</a></li>
									<li><a href="#">修改用户名</a></li>
									<li role="separator" class="divider"></li>
									<li><a href="#">Separated link</a></li>
								</ul></li>
						</ul>
					</div>
				</div>
			</nav>
		</div>
		<div class="row">
			<div class="col-md-2">
				<ul class="list-group">
					<li class="list-group-item"><a href="orderlist.html">订单列表</a></li>
					<li class="list-group-item"><a href="userlist.jsp">用户列表</a></li>
					<li class="list-group-item"><a href="cakelist.html">商品列表</a></li>
					<li class="list-group-item"><a href="comm.html">评论列表</a></li>
				</ul>
			</div>
			<form action="cakeimgupdate.html" method="post"
				enctype="multipart/form-data">
				<div class="col-md-10">
					<div class="row">
						<div class="form-group">
							<label for="cakeName">蛋糕名</label> <input type="text"
								class="form-control" id="cakeName"
								placeholder="- - - - 蛋糕名- - - -" value="${cakeName}"
								disabled="disabled">
						</div>
						<div class="col-md-10">
							<div class="row">
								<c:forEach var="c" items="${cakeImgs}">
									<div class="col-sm-6 col-md-4 showcakeimg">
										<div class="thumbnail">
											<img src="../image/productImg/${c.img}" class="imgpic"
												width="250px" height="200px"> <input type="hidden"
												class="cakeimgid" value="${c.id}" name="cakeimgid" />
											<div class="caption">
												<p style="text-align: center;">
													<button type="button" class="btn btn-primary deleteImg"
														style="background-color: brown">删除</button>
												</p>
											</div>
										</div>
									</div>
								</c:forEach>
								<input type="hidden" class="cakeid" value="${kid}"
													name="cakeid" />
							</div>
						</div>
					</div>
					<div class="form-group">
						<label for="exampleInputFile">蛋糕上传</label> <input type="file"
							name="cakeimg" id="exampleInputFile" multiple="multiple">
					</div>
					<a type="button" href="cakelist.html" class="btn btn-default">返回</a>
					<button type="submit" class="btn btn-default">保存</button>
					<div class="deletedemo"></div>
				</div>
		</div>
		</form>
	</div>
	</div>
	<script src="../js/jquery-1.11.3.js"></script>
	<script src="../js/bootstrap.min.js"></script>
</body>
</html>
